package com.pengtu.gsj.dao.zxgc;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.pengtu.gsj.dao.hibernate.HibernateDao;
import com.pengtu.gsj.entity.zxgc.SpecialProject;

@Repository
public class SpecialProjectDao extends HibernateDao<SpecialProject, String>{

	/**
	 * 
	 * getStatisticsSpecialProjects:
	 * 适用:统计某年度下所有符合要求（非作废）的专项工程数量
	 * @return 
	 * @exception 
	 * @since  1.0.0
	 */
	public List<SpecialProject> getStatisticsSpecialProjects() {
		String hql = "SELECT new com.pengtu.gsj.entity.zxgc.SpecialProject(t.year,count(t.year)) from SpecialProject t where t.delFlag ='0' and t.status !='1' GROUP BY t.year ORDER BY t.year";
		return find(hql);
	};
	
	/**
	 * 
	 * getSpecialProjectsByStatus:
	 * 适用:获得某年度下非作废状态项目的分类数据
	 * @return 
	 * @exception 
	 * @since  1.0.0
	 */
	public List<SpecialProject> getSpecialProjectsByStatus() {
		String hql = "SELECT new com.pengtu.gsj.entity.zxgc.SpecialProject(t.year,t.status,count(t.year)) from SpecialProject t where t.delFlag ='0' and t.status !='1' GROUP BY t.year, t.status ORDER BY t.year";
		return find(hql);
	}
}
